<?php
class Http_Google_Pr
{
	protected $_domain;
	protected $_url;
	protected $_obj;
	
	public function __construct($_url)
	{
		Zend_Loader::loadClass('Mivec_Http_Google_Pagerank');
		$this->_url = $_url;
		
		$this->_obj = new Mivec_Http_Google_Pagerank();
		
		self::_prepare();
		return $this;
	}

	private function _prepare()
	{
		//split url and get domain
		$_pattern = '/(http:\/\/.*?)\/{1}/is';
		preg_match($_pattern,$this->_url,$_cc);
		$this->_domain = $_cc[1];
	}
	
	public function getPR()
	{
		return $this->_obj->GetPR($this->_url);
	}
	
	public function getHomePR()
	{
		return $this->_obj->GetPR($this->_domain);
	}
}